package edu.gdkm.service.impl;


import edu.gdkm.service.iface.GoodsAlbumService;
import edu.gdkm.sql.dao.GoodsAlbumMapper;
import edu.gdkm.sql.pojo.GoodsAlbum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsAlbumServiceImpl implements GoodsAlbumService {

    @Autowired
    private GoodsAlbumMapper goodsAlbumMapper;

    @Override
    public List<GoodsAlbum> findAll() {
        return goodsAlbumMapper.findAll();
    }

    @Override
    public GoodsAlbum findById(Integer id) {
        return goodsAlbumMapper.findById(id);
    }

    @Override
    public void save(GoodsAlbum album) {
        goodsAlbumMapper.insert(album);
    }

    @Override
    public void update(GoodsAlbum album) {
        goodsAlbumMapper.update(album);
    }

    @Override
    public void delete(Integer id) {
        goodsAlbumMapper.delete(id);
    }

    @Override
    public List<GoodsAlbum> findByGoodsId(Integer goodsId) {
        return goodsAlbumMapper.findByGoodsId(goodsId);
    }
}
